<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;


class CreateOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('orders', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->tinyInteger('type')->comment('订单类型1押金2月租3换购');
            $table->tinyInteger('pay_type')->default(1)->comment('支付类型1微信');
            $table->string('order_no')->comment('订单号');
            $table->decimal('money','10','2')->comment('订单金额');
            $table->tinyInteger('status')->default(0)->comment('订单状态1已完成2已取消');
            $table->string('comment')->default('')->comment('订单备注');
            $table->timestamps();
        });

        DB::statement("ALTER TABLE `orders` comment '订单表';");

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('orders');
    }
}
